package com.yangmao.service.impl;

import com.github.pagehelper.PageHelper;
import com.yangmao.dao.ActivityInfoDao;
import com.yangmao.entity.ActivityInfo;
import com.yangmao.service.api.ActivityInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ‘洋毛’
 * @version 1.0
 * @description: TODO
 * @date 2022/1/7 9:23
 */
@Service
public class ActivityInfoServiceImpl implements ActivityInfoService {

    @Autowired
    private ActivityInfoDao activityInfoDao;

    @Override
    public List<ActivityInfo> getAllActivityInfo(int page, int size) {
        PageHelper.startPage(page,size);
        return activityInfoDao.getAllActivityInfo();
    }

    @Override
    public ActivityInfo getActivityInfoById(String activityId) {
        return activityInfoDao.getActivityInfoById(activityId);
    }

    @Override
    public void updateActivityInfo(ActivityInfo activityInfo) {
        activityInfoDao.updateActivityInfo(activityInfo);
    }

    @Override
    public void deleteActivityInfo(String id) {
        activityInfoDao.deleteActivityInfo(id);
    }

    @Override
    public void addActivityInfo(ActivityInfo activityInfo) {
        activityInfoDao.addActivityInfo(activityInfo);
    }
}
